package com.apes.hr.salary.rewardPunish.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.hr.base.model.Employee;
import com.apes.hr.salary.rewardPunish.model.PunishAppeal;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * @author LinWangZong
 * @create 2018-12-03 16:07
 */
public interface PunishAppealRepository extends CustomRepository<PunishAppeal, String>{

    @Query("select T from PunishAppeal T where 1 = 1 and (state like %:value% or id like %:value%) and employee =:employee ")
    Page<PunishAppeal> findByEmployee(@Param("value") String value, @Param("employee") Employee employee, Pageable pageable);
}
